<?php
require_once('../../conf/config.php.inc');
require_once(SYBMAS_LIB_PATH.'/liblogin.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/layout.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybmas.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/menu.php.inc');
require_once('libtablas.php.inc');
verificar_inicio_sesion();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/sybmasstyle.css">
<script src="<?php echo LAYOUT_URI?>/jquery-1.2.1.min.js"
	type="text/javascript"></script>
<script src="<?php echo LAYOUT_URI?>/menu-collapsed.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/style.css" />
<link rel="stylesheet" type="text/css"
	href="<?php echo JAVASCRIPT_URI?>/tabs/tabs.css">
<script src="<?php echo JAVASCRIPT_URI?>/tabs/tabs.js"
	type="text/javascript"></script>
<script type="text/javascript" src="<?php echo JAVASCRIPT_URI?>/commons.js"></script>
<script type="text/javascript" src="tabla.js"></script>
<title>.:: Sybmas - Bloquear o Desbloquear Logins</title>
<!--[if lt IE 8]>
   <style type="text/css">
   li a {display:inline-block;}
   li a {display:block;}
   </style>
   <![endif]-->      
</head>
<body>
<script src="<?php echo JAVASCRIPT_URI?>/tooltip/wz_tooltip.js"
	type="text/javascript"></script>
<center>
<div id="container">
<div id="header"><?php generar_header();?></div>
<div id="scene">
<div id="modulos">
<ul id="menu" style="width: 150px;">
<?php generar_menu();?>
</ul>
</div>

<div id="title">Bloquear o Desbloquear Logins</div>
<div id="main">

<?php $id=$_GET['suid'];?>

<?php
$sybuser_connection=start_default_sybuser_connection();
	$query="SELECT suid,name, ".
	       "CASE status WHEN 2 THEN 'Bloqueado' ".
	   	   "ELSE 'Desbloqueado' ".
	   	   "END AS status ".
	   	   "FROM master..syslogins ".
		   "WHERE suid=$id "; 	
	$result=sybase_query($query,$sybuser_connection);
	$data=sybase_fetch_array($result);
	$nomlogin=$data['name'];
	$status=$data['status'];			
?>

<div id="tab_panel">
<div id="tab_header">
<ul>
	
	<li id="selected"><a href="#" id="ctl_tabgeneral" onclick="showTab(this.id,0)"><?php echo $nomlogin?></a></li>
	<li><a href="#" id="ctl_tabroles" onclick="showTab(this.id,1)">Bloquear/Desbloquear Logins</a></li>		
</ul>
</div>

<div id="tab_content">

<div class="tab_scene" style="display: block">

<table width="80%" border="1">
	<caption><b>Informacion general del Login</b></caption>
	<tr>
		<th bgcolor="#8BA7C2">suid</th>
		<td ><?php echo $data['suid']?></td>
	</tr>
	<tr>
		<th bgcolor="#8BA7C2">name</th>	
		<td><?php echo $data['name']?></td>
	</tr>
	<tr>
		<th bgcolor="#8BA7C2">status</th>	
		<td><?php echo $data['status']?></td>
	</tr>	    
</table>
<br>
<input type="button" value = "Cancelar" onClick="history.back()">
</div><!-- tab_scene -->


<div class="tab_scene">
<div class="controls">
<form method="POST" action="desbloq.php" target="constraints_dialog" onsubmit="postDialog('constraints_dialog')">
<input type="hidden" name="desb" value="<?php echo $nomlogin?>">
<input type="hidden" name="estatus" value="<?php echo $status?>">
<input type="submit" value="Bloquear/Desbloquear Login">
<input type="button" value = "Cancelar" onClick="history.back()">			
</form>
</div>
<hr/>	
<table width="80%" border="1">
  <caption>Datos del Login</caption>
	
	<tr>	    
		<th bgcolor="#8BA7C2">suid</th>	 	
		<td><?php echo $data['suid']?></td>
	 </tr>
	 <tr>					  		
		<th bgcolor="#8BA7C2">name</th>
		<td><?php echo $data['name']?></td>
	 </tr>
	 <tr>
		<th bgcolor="#8BA7C2">status</th>	
		<td><?php echo $data['status']?></td>
	</tr>
<?php
		while($data=sybase_fetch_array($result)){			
			?>
		<tr>
			<td><?php echo $data['suid']?></td>
			<td><?php echo $data['name']?></td>
			<td><?php echo $data['status']?></td>			
<?php
		}		
		?>			
</table>
</div><!-- tab_scene -->			



</div>
</div>
<!-- main --></div>
<!-- scene -->
</div>
 <?php generar_footer();?></div>
</center>
</body>
</html> 	
